package com.hsmpay.mobile.dao.trans;
import com.hsmpay.common.dao.BaseDao;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;
import com.hsmpay.common.pojo.user.User;
import com.hsmpay.mobile.pojo.trans.TransOrder;
/**
 * 交易订单 dao 接口 transOrderDao
 * 对应pojo TransOrder
 * @author 颜铃璋
 * 创建时间：2013-1-21
 */
public interface TransOrderDao<Entity extends Serializable, Query extends Object> extends BaseDao<Entity, Query> {
    /**
     * 根据订单ID修改状态
     *
     * @param orderNum
     * @param status
     * @param clearing
     * @return
     */
    public int updateStatusClearing(String orderNum, Integer status, Integer clearing) throws SQLException;

    /**
     * 查出交易金额  总额
     *
     * @param transOrder
     * @return
     * @throws SQLException
     */
    public Double getTransMoneySum(TransOrder transOrder) throws SQLException;

    /**
     * 修改签名
     *
     * @param order
     * @return
     * @throws SQLException
     */
    public int updateSignaturePathByNum(TransOrder transOrder) throws SQLException;

    /**
     * 修改渠道手续费
     *
     * @param order
     * @return
     * @throws SQLException
     */
    public int updateRevenueFeeMoneyByNum(TransOrder transOrder) throws SQLException;

    /**
     * 修改提现订单号
     *
     * @param orderNum
     * @param cashOrderNum
     * @return
     * @throws SQLException
     */
    public int updateCashOrderByNum(String orderNum, String cashOrderNum) throws SQLException;

    /**
     * 修改未结算的订单 为结算处理中
     * 在修改绑定银行卡 后  判断有没有订单是未结算状态
     * 如果是 并且 不收8毛钱的订单  那么就修改状态为 处理中  这样就可以进行结算合单  并且可以  结算了
     *
     * @param orderNum
     * @return
     * @throws Exception
     */
    public int updateUnCOrderClearing(User user) throws SQLException;

    /**
     * 根据userid 获取未结算订单列表
     *
     * @param userId
     * @param status 交易状态  0交易失败 1交易成功 2银行交易处理中 3 未付款 4等待对方付款 5关闭交易 6 交易已撤销 7 交易发起撤销 8 未结算
     * @return
     * @throws SQLException
     */
    public List<TransOrder> searchOrderListByUserId(Long userId, Integer status) throws SQLException;

    /**
     * 根据userid 获取未结算订单 总金额
     *
     * @param userId
     * @return
     * @throws SQLException
     */
    public Double getUnCOrderTransMoneySumByUserId(Long userId) throws SQLException;

    /**
     * 修改 目标银行卡信息
     *
     * @param order
     * @return
     * @throws SQLException
     */
    public int updateObjectiveBankInfo(TransOrder order) throws SQLException;

    /**
     * 查询安心一百订单号
     *
     * @return
     * @throws SQLException
     */
    public Integer searchAnXinYBTransId() throws SQLException;

    /**
     * 查询辽宁银联订单号
     *
     * @return
     * @throws SQLException
     */
    public Integer searchLiaoNingTransId() throws SQLException;

    /**
     * 查询宁波银联订单号
     *
     * @return
     * @throws SQLException
     */
    public Integer searchNingBoTransId() throws SQLException;

    /**
     * 查询盛付通
     *
     * @return
     * @throws SQLException
     */
    public Integer searchShengFTTransId() throws SQLException;

    /**
     * ECB 交易
     *
     * @return
     * @throws SQLException
     */
    public Integer searchECBTransId() throws SQLException;
    /**
     * 瑞升 交易
     * @return
     * @throws SQLException
     */
    public Integer searchRuiShengTransId()throws SQLException;

    /**
     * 瑞升国通交易 流水
     * @return
     * @throws SQLException
     */
    public Integer searchRuiShengGTTransId()throws SQLException;

    /**
     * posp 交易
     *
     * @return
     * @throws SQLException
     */
    public Integer searchPospTransId() throws SQLException;

    /**
     * EPoint 交易
     *
     * @return
     * @throws SQLException
     */
    public Integer searchEPointTransId() throws SQLException;

    /**
     * 国通
     * @return
     * @throws SQLException
     */
    public Integer searchGuoTongTransId() throws SQLException;

    /**
     * E点支付
     * @return
     * @throws SQLException
     */
    public Integer searchIdeaioeTransId()throws SQLException;

    /**
     * 优银支付
     * @return
     * @throws SQLException
     */
    public Integer searchUinPayTransId() throws SQLException;

    /**
     * 银生宝支付
     * @return
     * @throws SQLException
     */
    public Integer searchYinShengBaoTransId() throws SQLException;

    /**
     * pos支付
     * @return
     * @throws SQLException
     */
    public Integer searchPOSTransId() throws SQLException;

    /**
     * 支付通支付
     * @return
     * @throws SQLException
     */
    public Integer searchZHIFUTONGTransId() throws SQLException;

    /**
     * 更新组织号
     * @param transOrder
     * @return
     * @throws SQLException
     */
    public int updateOrganization(TransOrder transOrder) throws SQLException;


    /**
     * 瑞鑫支付
     * @return
     * @throws SQLException
     */
    public Integer searchHanXinTransId() throws SQLException;

    /**
     * 中岚支付
     * @return
     * @throws SQLException
     */
    public Integer searchZhongLanTransId() throws SQLException;
    /**
     * 卡银卡支付
     * @return
     * @throws SQLException
     */
    public Integer searchKaYinKaTransId() throws SQLException;
}
